package com.gs.spring.core;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

public class GreetingInitializingBean implements InitializingBean {
	
	String message;
	
	public String getMessage() {
		return message;
	}


	public void setMessage(String message) {
		this.message = message;
	}


	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("afterPropertiesSet method called in class implemented by InitializingBean.");
		message = "Message has been initialized in afterPropertiesSet in class implemented by InitializingBean.";		
	}
	
	public void init(){
		System.out.println("Init method called in class implemented by InitializingBean.");
		message = "Message has been initialized in init() in class implemented by InitializingBean.";		
	}
	
}
